
#ifndef __SYSTASK_H
#define	__SYSTASK_H

#include <stdint.h>
#include "dataproc.h"
#include "pulse.h"
#include "rtctime.h"
#include "mytype.h"
#include "ui_touch.h"

#ifdef	__cplusplus
extern "C" {
#endif
	
#ifdef   _SYSTASK_MODULE_
#define  MY_EXT
#else
#define  MY_EXT  extern
#endif  

typedef struct
{
    uint32_t st;
} sys_info_type;

typedef struct 
{
    volatile uint32_t u_tick;
    volatile uint32_t powerup_time_cnt;
    volatile uint32_t clks_at_event_rcv;
        
    timer_pulse_type pulse;
    sig_time_type sig_time;
    TIME_Type rtc_time;
    led_breath_type led_obj;
    volatile uint8_t b_coremark;
    uint32_t exe_time_us;
    uint32_t exe_time_us_max;
    
    volatile uint8_t lx_clr_req;
    volatile uint8_t lx_tst_req;
    
    struct 
    {
        uint32_t addr;
        uint32_t data;
        uint32_t erase_time;
        uint32_t program_time;
        uint32_t read_time;
    }spim;
    
    struct
    {
        uint8_t ch_add;
        uint8_t del_req;
        uint8_t rst_comp;
        uint8_t ip_in;
        uint8_t str_len;
        int32_t min;
        int32_t max;
        uint8_t buff[48];
        ui_text_in_obj_type obj;
    } ui;
	
	uint32_t alain_val;
	uint32_t alain_src;
} sys_run_st_type;

MY_EXT sys_run_st_type sys_st;

#undef MY_EXT

#ifdef	__cplusplus
}
#endif

#endif	/* __SYSTASK_H */
